package org.jackysoft.mapper;

import java.util.Collection;

import org.apache.ibatis.annotations.Param;
import org.jackysoft.data.MapperDataProvider;
import org.jackysoft.entity.User;

public interface UserMapper extends MapperDataProvider<User> {

	
	void setEnabled(@Param("enabled") int enabled,@Param("name")String name);
	Collection<User> searchUsers(@Param("search")String search);
	int countOf(@Param("ctype")String ctype,@Param("value")String value);
	Collection<User> findOfType(@Param("ctype")String ctype,@Param("value")String value
			, @Param("offset")int offset,@Param("rows")int rowws);
	
	Collection<User> findBySecurityRole(@Param("rolename")String role,@Param("offset")int offset,@Param("rows")int rows);
    int countOfSecurityRole(@Param("rolename")String role);
    
    Collection<User> findAllByDepartments(@Param("idz")String idz);
   
    Collection<User> findAllByDepartment(@Param("id")String id);
    
    Collection<User> findAllByRole(@Param("id")String id);
    Collection<User> findAllByRoles(@Param("idz")String idz);
     
    Collection<User> resetDepartment(@Param("name")String name);
    
    void rideAuthority(String user,String securole);
    
    void rideDepartment(String user);
    void rideRole(String user);

}
